<%--
 *  File:   AnnualPlanAnalysisReport.jsp
 *  Desc:	Report Director depend on eSpreadsheet
 *
 *  Date		         Author		      Changes
 *  2013-08-07	  		 jackwang	 	  Created
 *   
 *
 *  Copyright (C) 2000 - 2008 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<%//init param
			String privilegeCode = "FP200020";
			//String strTableName = "";
			String strModuleName = "COM";
			String contextPath = request.getContextPath();

			%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<%@ include file="/rpt/ReportURL.inc"%>
<iframe name="reloadHandler" style="display:none"></iframe>
<html>
<head>
<title>AnnualPlanAnalysisReport</title>
<PageFlow:CheckPageFlow pageName="p_annualplananalysis" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/Calendar.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file ="/inc/NewCalendar.inc" %>

<%@ include file="/inc/SummaryDivision.inc" %>
<%Vector totalsummary = (Vector) pageContext.getAttribute("totalsummary");
			if (totalsummary == null)
				totalsummary = new Vector();		

			HashMap deptinfo = (HashMap) session.getAttribute("deptinfo");
			if (deptinfo == null)
				deptinfo = new HashMap();
			
			HashMap UserInfo = (HashMap) session.getAttribute("userinfo");
			if (UserInfo == null)
				UserInfo = new HashMap();
    Integer loginemployeeid = (Integer)UserInfo.get("employeeid");
    String  isadmin=(String)UserInfo.get("isadmin");
    java.util.Calendar cal = java.util.Calendar.getInstance(); 
    String flag = (String)pageContext.getAttribute("flag");
    
    HashMap orgInfo = (HashMap)pageContext.getAttribute("orginfo");

    if(orgInfo == null)
      orgInfo = new HashMap();
    
    Integer ishead = (Integer)orgInfo.get("ischain");
    if(ishead==null)
  	  ishead = new Integer(-1);
			%>

<%--  put your custom script here   --%>

<script language="JavaScript">
var popwindow;
function exportAreaPeople(){
	if(!checkForm(document.cform))return; 
	var yearplanid=document.cform.yearplanid.value;
	var loginid=document.cform.loginid.value;
	var planlevel=document.cform.planlevel.value;
	var flag1=document.cform.flag1.value;
	var flag2=document.cform.flag2.value;
	if(planlevel >flag1 || planlevel>= flag2){
	  alert("条件2必须小于或等于分析层级，条件3要小于分析层级"); 
	  return;
	}
	//alert(upplanlevel);
	var url = "<%=reportURL%>/servlet/ExcecuteReport/YearPlanKPIReport.sox?__format=xlsx&__folder=/ovalreport";
    <%//if("Y".equals(isadmin)){%>
    url=url+"&yearplanid="+yearplanid+"&planlevel="+escape(encodeURI(planlevel))+"&flag1="+escape(encodeURI(flag1))+"&flag2="+escape(encodeURI(flag2));
    var strstatus="height=768, width=1024,top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
	popwindow = window.open(url, "n1window", strstatus);
}
function selectattribute(){
var yearplanid = document.cform.yearplanid.value;
var  datahandler = new  DataHandler() ;
datahandler.add_params("yearplanid" , yearplanid,"integer") ;
datahandler.add_params("flag" , 999999,"integer") ;
datahandler.getResultFromVector("plantypesummary","valuename" ,"value" ,"document.cform.planlevel") ;
datahandler.getResultFromVector("plantypesummary","valuename" ,"value" ,"document.cform.flag1") ;
datahandler.getResultFromVector("plantypesummary","valuename" ,"value" ,"document.cform.flag2") ;
datahandler.add_job("j_getplanlevel") ;
datahandler.runDataHandler ();
}
function selectattribute1(){
var yearplanid = document.cform.yearplanid.value;
var planlevel = document.cform.planlevel.value;
var  datahandler = new  DataHandler() ;
datahandler.add_params("yearplanid" , yearplanid,"integer") ;
datahandler.add_params("planlevel" , planlevel,"integer") ;
datahandler.getResultFromHashMap("hash","planlevel"  ,"document.cform.upplanlevel") ;
datahandler.add_job("j_getplanlevel1") ;
datahandler.runDataHandler ();
}
</script>

</head>
<body style="overflow: auto;" >
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
	<input type="hidden" name="pagename" value="p_annualplananalysis">
	<input type="hidden" name="actionname">
	<input type="hidden" name="prodcode">
	<input type="hidden" name="upplanlevel">
    <input type="hidden" name="flag"/>
	<custom:hidden property="languagecode" scope="session" name="userinfo"/>
	<custom:hidden property="userid" scope="session" name="userinfo" changedName="loginid"/>
	<%--  page location   --%>
<%@ include file="/inc/PageLocation.inc"%>


<table width="100%" border="0" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
<!-------------------------------------1 row -------------------------------------------------->
		<td class="title_center">
			<div align="right">
				<font color="red">年度计划<%=label.getLabelName("L_Colon")%></font>
			</div>
		</td>
		<td>
			<custom:select property="yearplanid" optionsName="yearplanvector" command="notnull"   optionValueKey="yearplanid" optionInnerTextKey="yearplanname" defaultValue="--------" defaultValueCost="" onchange="selectattribute()"/>
	    <script>
	      document.cform.yearplanid.label="年度计划";
	    </script>
	    </td>
	    <td class="title_center">
			<div align="right">
				分析层级:
			</div>
		</td>
        <td>
          <custom:select   property="planlevel" optionsName="plantypesummary"  command="notnull"  optionValueKey="value" optionInnerTextKey="valuename"  defaultValue="--------------" defaultValueCost="" />
        </td>
        <td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_Condition")+"2"+ label.getLabelName("L_Colon")%>
			</div>
		</td>
        <td>
          <custom:select   property="flag1" optionsName="plantypesummary"  command="notnull"  optionValueKey="value" optionInnerTextKey="valuename"  defaultValue="--------------" defaultValueCost="" />
        </td>
        <td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_Condition")+"3"+ label.getLabelName("L_Colon")%>
			</div>
		</td>
        <td>
          <custom:select   property="flag2" optionsName="plantypesummary" command="notnull"  optionValueKey="value" optionInnerTextKey="valuename"  defaultValue="--------------" defaultValueCost="" />
        </td>
        <script>
          document.cform.planlevel.label="分析层级";
          document.cform.flag1.label="<%=label.getLabelName("L_Condition")%>1";
          document.cform.flag2.label="<%=label.getLabelName("L_Condition")%>2";
        </script>
        <td width="40%">&nbsp;</td>
	</tr>
<!-------------------------------------2 row -------------------------------------------------->
<!-------------------------------------3 row -------------------------------------------------->


<!--	-----------------------------------------4row---------------------------------------->

 </table>

		 <table width="100%" cellspacing="0" cellpadding="0">
		        <tr>
		          <td class="summary_top"></td>
		        </tr>
		        
		        <tr>
		          	<td class="td_center">
			  		
				  		
				  		<a onclick="javascript:exportAreaPeople();"><custom:button type="1"   label="L_Execcd" imgsrc="CreatSubDept.gif" border="0"/></a>
                        <!-- 
                        <a onclick="javascript:exportAreaPeople1();"><custom:button type="1"  imgsrc="CreatSubDept.gif" border="0" value="版本明细导出"/></a>
					     -->
					</td>
		        </tr>
     	</table>
</form>
</body>
</html>
